﻿using System;
using NUnit.Framework;
using SUT.Utils;

namespace SUT.Fixture2.Utils
{
    [TestFixture]
    public class SuperMathFixture
    {
        SuperMath m_math;

        [SetUp]
        public void Setup()
        {
            m_math = new SuperMath();
        }

        [Test]
        public void Division_ByZero_ThrowsArgumentException2()
        {
            Assert.IsNotNull(m_math);
            Assert.Throws<ApplicationException>(() => m_math.Division(1,0));
            Assert.IsNull(m_math);
        }

        [Test, ExpectedException(typeof(ApplicationException))]
        public void Division_ByZero_ThrowsArgumentException()
        {
            Assert.IsNotNull(m_math);
            m_math.Division(1, 0);
            Assert.IsNull(m_math);
        }

        [Test]
        public void Sum_1And1_2()
        {
            int result = m_math.Sum(1, 1);
            Assert.AreEqual(2, result);
        }
    }
}
